﻿using Logistics.WebApi.Attributes;
using System.Collections.Generic;
using System.Web;
using System.Web.Http;
using System.Web.Http.Filters;
using System.Web.Mvc;

namespace Logistics.WebApi
{
    public class FilterConfig
    {
        public static void RegisterGlobalFilters()
        {
            GlobalConfiguration.Configuration.Filters.Add(new JsonCallbackAttribute());
            //GlobalConfiguration.Configuration.Filters.Add(new ExceptionFilter());
        }
    }

    public class ExceptionFilter : ExceptionFilterAttribute
    {
        public override void OnException(HttpActionExecutedContext filterContext)
        {
            base.OnException(filterContext);
            //ErrorLogModule errorLog = new ErrorLogModule();
            //errorLog.LogException(filterContext.Exception, null , filterContext.Exception.Message);            
        }
    }
}